<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width"/>
    <title>
        大萌の记事本 | 记录日常生活，看世间繁华
    </title>

    <style>
        .hightlight {
            /*border-radius: 15px;*/
            /*-webkit-box-shadow: 0 0 5px rgba(0,113,241,1);*/
            background: burlywood;
        }
    </style>
    <!-- #style -->


    <link rel="stylesheet" type="text/css" media="all" href="" th:href="@{/asserts/css/style.css}"/>
    <link rel="stylesheet" href="#" type="text/css" media="screen" th:href="@{/asserts/css/wp-page-numbers.css}"/>
    <!-- 管理博客下拉菜单 -->
    <link rel="stylesheet" href="#" type="text/css" media="screen" th:href="@{/diy/dropdown_menus.css}"/>
    <!-- 文章过长省略 -->
    <link rel="stylesheet" href="#" type="text/css" media="screen" th:href="@{/diy/contentEllipsis.css}" />
    <!-- #css -->
    <script type="text/javascript" src="#" th:src="@{/asserts/js/jquery-3.2.1.slim.min.js}"></script>
    <!-- #js -->
</head>


<body data-rsssl=1 class="home blog two-column right-sidebar">
    <div id="page" class="hfeed">

        <div th:replace="commons/layout :: #branding"/>
        <!-- #导航、首图、搜索 -->

        <div id="main">

            <div id="primary">
                <div id="content" role="main">
                    <div th:each="article:${articles}">
                        <article id="post-891"
                                 class="post-891 post type-post status-publish format-standard hentry category-code tag-93">
                            <header class="entry-header">
                                <h1 class="entry-title"><a href="#" th:href="@{'/toArticle/' + ${article.getArtId()}}"
                                                           rel="bookmark">[[${article.getTitle()}]]</a>
                                </h1>

                                <div class="entry-meta">
                                    <span class="sep">发表于</span>
                                        <time class="entry-date" th:text="${#dates.format(article.getCreateTime(),'yyyy-MM-dd HH:mm:ss')}"></time>
                                    <span class="by-author"><span class="sep">由</span><span class="author vcard"><a
                                        class="url fn n" href="https://www.yuuko0623.com/t/author/admin"
                                        title="查看所有由大萌发布的文章"
                                        rel="author">[[${article.getNickName()}]]</a></span></span>完成
                                    <a id="modeifyArt" th:href="@{ '/modifyArticle/' + ${article.getArtId()} }" shiro:hasPermission="user:manager" >修改</a>
                                    <a id="deleArt" th:href="@{ '/deleArticle/' + ${article.getArtId()}}"
                                       onclick='return del();' shiro:hasPermission="user:manager">删除</a>

                                </div>
                                <!-- .entry-meta -->

                                <div class="comments-link">
                                    <a href="#">
                                        <span
                                            class="leave-reply">回复
                                        </span>
                                    </a>
                                </div>
                            </header>
                            <!-- .entry-header -->

                            <div class="entry-content" id="article_html" th:utext="${article.getHtml_content()}">
                            </div>
                            <!-- .entry-content -->

                            <footer class="entry-meta">
                                    <span class="cat-links">
                <span class="entry-utility-prep entry-utility-prep-cat-links">发表在</span>
                                    <a th:href="@{'/home/' + ${article.getTagId()}}" rel="category tag">[[${article.getTagName()}]]</a>
                                    </span>
                                <span class="sep"> | </span>
                                <span class="comments-link">
                                    <a href="#" th:href="@{'/toArticle/' + ${article.getArtId()} + '#respond'}">
                                        <span
                                            class="leave-reply">发表评论
                                        </span>
                                    </a>
                                </span>
                                <span class="sep"> | </span>
                                <span class="sep"> 阅读数：[[${article.getReadingQuantity()}]] </span>

                            </footer>
                            <!-- .entry-meta -->
                        </article>
                    </div>
                    <!-- #文章 -->
                    <div id='wp_page_numbers'>
                        <ul>
                            <li id="first_page">
                                <a href="" th:href="@{'/home/' + ${currentTag} + '?pageNum=1' }">&lt;</a>
                            </li>
                            <div id="pageNav"></div>
                            <!-- #分页 -->
                            <li id="last_page">
                                <a href="" th:href="@{ '/home/' + ${currentTag} + '?pageNum=' + ${ arts_size % pageSize == 0 ? arts_size/pageSize : arts_size/pageSize + 1 }  } " >&gt;</a>
                                <!--<a href="" th:href="@{/home/}  + ${currentTag} + '?pageNum=' +-->
                                <!--(${articles.size()}!=0? ( ${arts_size}/${articles.size()}  > 0 ? ${arts_size}/${articles.size()} : 1) : 1)">&gt;</a>-->
                            </li>
                        </ul>
                        <div style='float: none; clear: both;'></div>
                    </div>
                    <!-- #分页 -->
                </div>
                <!-- #文章 + 分页 -->
                <div id="supplementary" class="two">
                    <div id="first" class="widget-area" role="complementary">
                        <aside id="custom_html-4" class="widget_text widget widget_custom_html">
                            <div class="textwidget custom-html-widget">投诉联系：tixiangzhi#gmail.com (#换@ 投稿文章请发送到这个邮箱) <br/>
                                <img src="https://www.hacg.me/hacg.jpg" alt="琉璃神社"/>少上点网，多点运动；好好学习，天天向上。<br/>
                                <br/>
                            </div>
                        </aside>
                    </div>
                    <div id="second" class="widget-area" role="complementary">
                        <aside id="custom_html-5" class="widget_text widget widget_custom_html">
                            <div class="textwidget custom-html-widget">本站只提供资讯，不提供任何上传下载服务，所有内容均来自分享站点所提供的公开引用资讯。
                                如果有版权违规内容，请通知作者删除。 本站不支持 IE8 浏览器 如果网页显示不正常，请升级到 IE9 及以上 推荐使用 IE11、Firefox、Chrome 等专业浏览器
                            </div>
                        </aside>
                    </div>
                </div>
                <!-- #投诉 + 补充说明 -->
            </div>
            <!-- #文章、分页、投诉、补充说明 -->

            <div th:replace="commons/layout :: #secondary"/>
            <!-- #头像、文章归档、最新评论 -->

        </div>
        <!-- #main -->

        <div th:replace="commons/layout :: #colophon"/>
        <!-- #备注 -->

    </div>
    <!-- #page -->


    <script language='javascript' th:inline="javascript">

    // 分页js
    // var allPage = [[ ${articles.size() != 0 ? ( arts_size/articles.size()  > 0 ? arts_size/articles.size() : 1) : 1 } ]];
    var allPage = [[${ arts_size % pageSize == 0 ? arts_size/pageSize : arts_size/pageSize + 1 }]];
    var currentTag = [[${currentTag}]];
    var currentPage = [[${pageNum}]];
    // alert("allPage"+allPage);
    // alert("currentTag"+currentTag);
    for (var i = 1; i <= allPage; i++) {
        var loca = "/home/" + currentTag + "?pageNum=" + i;
        var theClass = currentPage == i ? 'hightlight' : '';
        var li = $("<li></li>").append($("<a></a>").attr("href", loca).addClass(theClass).text(i));
        li.appendTo("#pageNav");
        // th:class="${currentTag} == ${tag.getId()} ? 'hightlight
    }

    // 删除js
    function del() {
        if (confirm("确定要删除吗？")) {
            alert("删除成功");
            return true;
        }
        else {
            return false;
        }
    }

</script>

</body>

</html>